using System;
using UnityEngine;
using UnityEngine.UIElements;

public class MenuPanel : MonoBehaviour
{
    private Button newGameButton;
    private Button quitGameButton;

    public ObjectEventSO loadGameMenuEvent;
    private void OnEnable()
    {
        GetComponent<UIDocument>().rootVisualElement.Q<Button>("NewGameButton").clicked += OnNewGameButtonClicked;
        GetComponent<UIDocument>().rootVisualElement.Q<Button>("QuitGameButton").clicked += OnQuitGameButtonClicked;
    }

    private void OnNewGameButtonClicked()
    {
        loadGameMenuEvent.RaisEvent(null,this);
    }

    private void OnQuitGameButtonClicked() => Application.Quit();


}
